<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增房型')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-roomType-add" th:object="${hotelRoomType}">
        <input id="id" name="id" type="hidden" th:field="*{id}">
        <input id="hotelId" name="hotelId" type="hidden" th:field="*{hotelId}">
        <div class="form-group">
            <label class="col-sm-3 control-label ">房间类型：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="title" id="title" th:field="*{title}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">类型备注：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="remark" id="remark" th:field="*{remark}" >
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "hotel/room/type";

    $("#form-roomType-add").validate({
        onkeyup: false,
        rules:{
            // userPhone:{
            // 	isPhone:true
            // },
            // userEmail:{
            // 	email:true
            // },
        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-roomType-add').serialize());
        }
    }
</script>
</body>
</html>
